/*
Irving Derin:
 This is a simple sketch that allows for the transmission of 9 bytes to a recieving 
 coordinator. The recieving address for this coordinator is "0x0010", this is the 
 ATMY value that can be set either using a serial connection directly to the boards 
 that are going to be transmitting. 
 
 
 */

#include <SoftwareSerial.h>  //Serial Library
#include <stdlib.h>
#include <XBee.h>            //Xbee Library
XBee xbee = XBee();  // Creates XBee object 


uint8_t payload[] = { 'H', 'I', 0};                   

Tx16Request tx = Tx16Request(0x0010, payload, sizeof(payload)); // Creation of the object to be sent

int blah = random(21);

void setup(){
  //Serial.begin(9600);
  xbee.begin(9600);
  Serial.begin(9600);
}


void loop(){
  
  for(int i = 0; i < 3; i++){
    payload[i] = random(255);
    Serial.println(payload[i]);
  }
  xbee.send(tx);
  Serial.println("\n Sent");
  delay(5000);
}


